import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { PublicComponent } from './public.component';
import {RouterModule, Routes} from '@angular/router';
import { ThemeModule } from '../@theme/theme.module';
import { TraceComponent } from './trace/trace.component';
import {PeerSearchComponent} from '../shared/peer-search/peer-search.component';
import { QuestionComponent } from './question/question.component';
import {SharedModule} from '../shared/shared.module';
import {NgxAmapModule} from 'ngx-amap';
import { FindBlockComponent } from './find-block/find-block.component';

const appRoutes: Routes = [
  { path: '' ,
    component: PublicComponent ,
    children : [
      {
        path: 'trace/:Batch',
        component: TraceComponent,
      },
      {
        path: 'trace',
        component: TraceComponent,
      },
      {
        path: 'peers',
        component: PeerSearchComponent,
      },
      {
        path: 'question',
        component: QuestionComponent,
      },
      {
        path: 'find-block',
        component: FindBlockComponent,
      }
    ]
  }
];

@NgModule({
  declarations: [PublicComponent, TraceComponent, QuestionComponent, FindBlockComponent],
  imports: [
    CommonModule,
    RouterModule.forChild(
      appRoutes,
    ),
    ThemeModule,
    SharedModule,
    NgxAmapModule.forRoot({
      apiKey: '1b71999862f66477e407fa81b0de018a'
    })
  ]
})
export class PublicModule { }
